/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.server.modules.sys.entity.loan;

import com.server.common.utils.StringUtils;
import org.hibernate.validator.constraints.Length;

import com.server.common.persistence.DataEntity;

/**
 * 客户申请记录Entity
 * @author 王磊
 * @version 2016-09-19
 */
public class CustomPay extends DataEntity<CustomPay> {
	
	private static final long serialVersionUID = 1L;
	protected String loanid;		// 贷款产品ID
	protected String memberid;		// 用户ID
	protected String serviceCharge;		// 服务费
	protected String memberLoanLimit;		// 客户需要贷款额度
	protected String loanLimit;		// 预期会审批额度
	protected String finishLoanLimit;		// 最终下款额度
	protected String name;		// 产品名称
	protected String memberPhone;		// 用户联系方式
	protected String memberName;		// member_name
	protected String orderNum;		// 订单号
	protected String orderFlag;		// 订单状态，0未付款，1付款成功，2付款失败
	protected String rate;		// 利率
	protected String memberRealName;
	protected Integer materialUploadNotClearCount;//不清晰的资料数量
	protected String customServiceId;//客服人员id
	protected String customServiceName;//客服人员name
	protected String loanManagerName;//产品的客服人员name
	protected String managerId;//商务人员id
	protected String managerName;//商务人员name
	protected String loanBankName;		//
	protected String memberPhoneGeo;		//
	protected String servicenum; //服务记录数量
	protected String businessnum; //商务谈单记录数量
	protected String moneyDate; //下款时间
	protected String usernameFake; //隐藏电话号码中间四位
	protected String moneyEnd; //下款结束时间（筛选结束时间）

	public String getMoneyEnd() {
		return moneyEnd;
	}

	public void setMoneyEnd(String moneyEnd) {
		this.moneyEnd = moneyEnd;
	}

	public String getMoneyDate() {
		return moneyDate;
	}

	public void setMoneyDate(String moneyDate) {
		this.moneyDate = moneyDate;
	}



	public String getManagerId() {
		return managerId;
	}

	public void setManagerId(String managerId) {
		this.managerId = managerId;
	}

	public String getManagerName() {
		return managerName;
	}

	public void setManagerName(String managerName) {
		this.managerName = managerName;
	}

	protected String origin;		// 来源0移动端 1pc端

	public String getOrigin() {
		return origin;
	}

	public void setOrigin(String origin) {
		this.origin = origin;
	}

	public String getFinishLoanLimit() {
		return finishLoanLimit;
	}

	public void setFinishLoanLimit(String finishLoanLimit) {
		this.finishLoanLimit = finishLoanLimit;
	}

	public String getLoanManagerName() {
		return loanManagerName;
	}

	public void setLoanManagerName(String loanManagerName) {
		this.loanManagerName = loanManagerName;
	}

	public String getMemberPhoneGeo() {
		return memberPhoneGeo;
	}

	public void setMemberPhoneGeo(String memberPhoneGeo) {
		this.memberPhoneGeo = memberPhoneGeo;
	}

	public String getLoanBankName() {
		return loanBankName;
	}

	public void setLoanBankName(String loanBankName) {
		this.loanBankName = loanBankName;
	}

	public String getCustomServiceName() {
		return customServiceName;
	}
	public void setCustomServiceName(String customServiceName) {
		this.customServiceName = customServiceName;
	}

	public String getCustomServiceId() {
		return customServiceId;
	}

	public void setCustomServiceId(String customServiceId) {
		this.customServiceId = customServiceId;
	}

	public String getRate() {
		return rate;
	}

	public void setRate(String rate) {
		this.rate = rate;
	}

	public Integer getMaterialUploadNotClearCount() {
		return materialUploadNotClearCount;
	}

	public void setMaterialUploadNotClearCount(Integer materialUploadNotClearCount) {
		this.materialUploadNotClearCount = materialUploadNotClearCount;
	}

	public String getMemberRealName() {
		return memberRealName;
	}

	public void setMemberRealName(String memberRealName) {
		this.memberRealName = memberRealName;
	}

	public CustomPay() {
		super();
	}

	public CustomPay(String id){
		super(id);
	}

	@Length(min=0, max=64, message="贷款产品ID长度必须介于 0 和 64 之间")
	public String getLoanid() {
		return loanid;
	}

	public void setLoanid(String loanid) {
		this.loanid = loanid;
	}
	
	@Length(min=0, max=64, message="用户ID长度必须介于 0 和 64 之间")
	public String getMemberid() {
		return memberid;
	}

	public void setMemberid(String memberid) {
		this.memberid = memberid;
	}
	
	public String getServiceCharge() {
		return serviceCharge;
	}

	public void setServiceCharge(String serviceCharge) {
		this.serviceCharge = serviceCharge;
	}
	
	public String getMemberLoanLimit() {

		return StringUtils.isBlank(memberLoanLimit)?"0":memberLoanLimit;
	}

	public void setMemberLoanLimit(String memberLoanLimit) {
		this.memberLoanLimit = memberLoanLimit;
	}
	
	public String getLoanLimit() {

		return StringUtils.isBlank(loanLimit)?"0":loanLimit;
	}

	public void setLoanLimit(String loanLimit) {
		this.loanLimit = loanLimit;
	}
	
	@Length(min=0, max=255, message="产品名称长度必须介于 0 和 255 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=255, message="用户联系方式长度必须介于 0 和 255 之间")
	public String getMemberPhone() {
		return memberPhone;
	}

	public void setMemberPhone(String memberPhone) {
		this.memberPhone = memberPhone;
	}
	
	@Length(min=0, max=255, message="member_name长度必须介于 0 和 255 之间")
	public String getMemberName() {
		return memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}
	
	@Length(min=1, max=128, message="订单号长度必须介于 1 和 128 之间")
	public String getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}
	
	@Length(min=0, max=255, message="订单状态，0未付款，1付款成功，2付款失败长度必须介于 0 和 255 之间")
	public String getOrderFlag() {
		return orderFlag;
	}

	public void setOrderFlag(String orderFlag) {
		this.orderFlag = orderFlag;
	}
	public String getServicenum() {
		return servicenum;
	}

	public void setServicenum(String servicenum) {
		this.servicenum = servicenum;
	}
	public String getBusinessnum() {
		return businessnum;
	}

	public void setBusinessnum(String businessnum) {
		this.businessnum = businessnum;
	}
	public String getUsernameFake() {
		if(StringUtils.isNotBlank(memberPhone)){
			return memberPhone.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2");
		}
		return usernameFake;
	}

	public void setUsernameFake(String usernameFake) {

		this.usernameFake = usernameFake;
	}
}